Integrand size = 23, antiderivative size = 241 \[ \int (a+b \cos (c+d x))^4 (A+B \cos (c+d x)) \, dx=\frac {1}{8} \left (8 a^4 A+24 a^2 A b^2+3 A b^4+16 a^3 b B+12 a b^3 B\right ) x+\frac {\left (95 a^3 A b+80 a A b^3+12 a^4 B+112 a^2 b^2 B+16 b^4 B\right ) \sin (c+d x)}{30 d}+\frac {b \left (130 a^2 A b+45 A b^3+24 a^3 B+116 a b^2 B\right ) \cos (c+d x) \sin (c+d x)}{120 d}+\frac {\left (35 a A b+12 a^2 B+16 b^2 B\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{60 d}+\frac {(5 A b+4 a B) (a+b \cos (c+d x))^3 \sin (c+d x)}{20 d}+\frac {B (a+b \cos (c+d x))^4 \sin (c+d x)}{5 d} \]
1/8*(8*A*a^4+24*A*a^2*b^2+3*A*b^4+16*B*a^3*b+12*B*a*b^3)*x+1/30*(95*A*a^3* b+80*A*a*b^3+12*B*a^4+112*B*a^2*b^2+16*B*b^4)*sin(d*x+c)/d+1/120*b*(130*A* a^2*b+45*A*b^3+24*B*a^3+116*B*a*b^2)*cos(d*x+c)*sin(d*x+c)/d+1/60*(35*A*a* b+12*B*a^2+16*B*b^2)*(a+b*cos(d*x+c))^2*sin(d*x+c)/d+1/20*(5*A*b+4*B*a)*(a +b*cos(d*x+c))^3*sin(d*x+c)/d+1/5*B*(a+b*cos(d*x+c))^4*sin(d*x+c)/d
Time = 1.53 (sec) , antiderivative size = 263, normalized size of antiderivative = 1.09 \[ \int (a+b \cos (c+d x))^4 (A+B \cos (c+d x)) \, dx=\frac {480 a^4 A c+1440 a^2 A b^2 c+180 A b^4 c+960 a^3 b B c+720 a b^3 B c+480 a^4 A d x+1440 a^2 A b^2 d x+180 A b^4 d x+960 a^3 b B d x+720 a b^3 B d x+60 \left (32 a^3 A b+24 a A b^3+8 a^4 B+36 a^2 b^2 B+5 b^4 B\right ) \sin (c+d x)+120 b \left (6 a^2 A b+A b^3+4 a^3 B+4 a b^2 B\right ) \sin (2 (c+d x))+160 a A b^3 \sin (3 (c+d x))+240 a^2 b^2 B \sin (3 (c+d x))+50 b^4 B \sin (3 (c+d x))+15 A b^4 \sin (4 (c+d x))+60 a b^3 B \sin (4 (c+d x))+6 b^4 B \sin (5 (c+d x))}{480 d} \]
(480*a^4*A*c + 1440*a^2*A*b^2*c + 180*A*b^4*c + 960*a^3*b*B*c + 720*a*b^3* B*c + 480*a^4*A*d*x + 1440*a^2*A*b^2*d*x + 180*A*b^4*d*x + 960*a^3*b*B*d*x + 720*a*b^3*B*d*x + 60*(32*a^3*A*b + 24*a*A*b^3 + 8*a^4*B + 36*a^2*b^2*B + 5*b^4*B)*Sin[c + d*x] + 120*b*(6*a^2*A*b + A*b^3 + 4*a^3*B + 4*a*b^2*B)* Sin[2*(c + d*x)] + 160*a*A*b^3*Sin[3*(c + d*x)] + 240*a^2*b^2*B*Sin[3*(c + d*x)] + 50*b^4*B*Sin[3*(c + d*x)] + 15*A*b^4*Sin[4*(c + d*x)] + 60*a*b^3* B*Sin[4*(c + d*x)] + 6*b^4*B*Sin[5*(c + d*x)])/(480*d)
Time = 0.80 (sec) , antiderivative size = 254, normalized size of antiderivative = 1.05, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3042, 3232, 3042, 3232, 3042, 3232, 3042, 3213}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+b \cos (c+d x))^4 (A+B \cos (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^4 \left (A+B \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 3232 |
\(\displaystyle \frac {1}{5} \int (a+b \cos (c+d x))^3 (5 a A+4 b B+(5 A b+4 a B) \cos (c+d x))dx+\frac {B \sin (c+d x) (a+b \cos (c+d x))^4}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{5} \int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^3 \left (5 a A+4 b B+(5 A b+4 a B) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {B \sin (c+d x) (a+b \cos (c+d x))^4}{5 d}\) |
\(\Big \downarrow \) 3232 |
\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \int (a+b \cos (c+d x))^2 \left (20 A a^2+28 b B a+15 A b^2+\left (12 B a^2+35 A b a+16 b^2 B\right ) \cos (c+d x)\right )dx+\frac {(4 a B+5 A b) \sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\right )+\frac {B \sin (c+d x) (a+b \cos (c+d x))^4}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (20 A a^2+28 b B a+15 A b^2+\left (12 B a^2+35 A b a+16 b^2 B\right ) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {(4 a B+5 A b) \sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\right )+\frac {B \sin (c+d x) (a+b \cos (c+d x))^4}{5 d}\) |
\(\Big \downarrow \) 3232 |
\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \int (a+b \cos (c+d x)) \left (60 A a^3+108 b B a^2+115 A b^2 a+32 b^3 B+\left (24 B a^3+130 A b a^2+116 b^2 B a+45 A b^3\right ) \cos (c+d x)\right )dx+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \sin (c+d x) (a+b \cos (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\right )+\frac {B \sin (c+d x) (a+b \cos (c+d x))^4}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (60 A a^3+108 b B a^2+115 A b^2 a+32 b^3 B+\left (24 B a^3+130 A b a^2+116 b^2 B a+45 A b^3\right ) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \sin (c+d x) (a+b \cos (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\right )+\frac {B \sin (c+d x) (a+b \cos (c+d x))^4}{5 d}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \sin (c+d x) (a+b \cos (c+d x))^2}{3 d}+\frac {1}{3} \left (\frac {b \left (24 a^3 B+130 a^2 A b+116 a b^2 B+45 A b^3\right ) \sin (c+d x) \cos (c+d x)}{2 d}+\frac {2 \left (12 a^4 B+95 a^3 A b+112 a^2 b^2 B+80 a A b^3+16 b^4 B\right ) \sin (c+d x)}{d}+\frac {15}{2} x \left (8 a^4 A+16 a^3 b B+24 a^2 A b^2+12 a b^3 B+3 A b^4\right )\right )\right )+\frac {(4 a B+5 A b) \sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\right )+\frac {B \sin (c+d x) (a+b \cos (c+d x))^4}{5 d}\) |
(B*(a + b*Cos[c + d*x])^4*Sin[c + d*x])/(5*d) + (((5*A*b + 4*a*B)*(a + b*C os[c + d*x])^3*Sin[c + d*x])/(4*d) + (((35*a*A*b + 12*a^2*B + 16*b^2*B)*(a + b*Cos[c + d*x])^2*Sin[c + d*x])/(3*d) + ((15*(8*a^4*A + 24*a^2*A*b^2 + 3*A*b^4 + 16*a^3*b*B + 12*a*b^3*B)*x)/2 + (2*(95*a^3*A*b + 80*a*A*b^3 + 12 *a^4*B + 112*a^2*b^2*B + 16*b^4*B)*Sin[c + d*x])/d + (b*(130*a^2*A*b + 45* A*b^3 + 24*a^3*B + 116*a*b^2*B)*Cos[c + d*x]*Sin[c + d*x])/(2*d))/3)/4)/5
3.3.42.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[1/(m + 1) Int[(a + b*Sin[e + f*x])^(m - 1)*Simp[b* d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ [{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]
Time = 3.92 (sec) , antiderivative size = 197, normalized size of antiderivative = 0.82
method | result | size |
parts | \(a^{4} x A +\frac {\left (A \,b^{4}+4 B a \,b^{3}\right ) \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {\left (4 A a \,b^{3}+6 B \,a^{2} b^{2}\right ) \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}+\frac {\left (6 A \,a^{2} b^{2}+4 B \,a^{3} b \right ) \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {\left (4 A \,a^{3} b +B \,a^{4}\right ) \sin \left (d x +c \right )}{d}+\frac {B \,b^{4} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5 d}\) | \(197\) |
parallelrisch | \(\frac {\left (720 A \,a^{2} b^{2}+120 A \,b^{4}+480 B \,a^{3} b +480 B a \,b^{3}\right ) \sin \left (2 d x +2 c \right )+\left (160 A a \,b^{3}+240 B \,a^{2} b^{2}+50 B \,b^{4}\right ) \sin \left (3 d x +3 c \right )+\left (15 A \,b^{4}+60 B a \,b^{3}\right ) \sin \left (4 d x +4 c \right )+6 B \sin \left (5 d x +5 c \right ) b^{4}+\left (1920 A \,a^{3} b +1440 A a \,b^{3}+480 B \,a^{4}+2160 B \,a^{2} b^{2}+300 B \,b^{4}\right ) \sin \left (d x +c \right )+480 x d \left (a^{4} A +3 A \,a^{2} b^{2}+\frac {3}{8} A \,b^{4}+2 B \,a^{3} b +\frac {3}{2} B a \,b^{3}\right )}{480 d}\) | \(201\) |
derivativedivides | \(\frac {\frac {B \,b^{4} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+A \,b^{4} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+4 B a \,b^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {4 A a \,b^{3} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 B \,a^{2} b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+6 A \,a^{2} b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+4 B \,a^{3} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+4 A \sin \left (d x +c \right ) a^{3} b +B \,a^{4} \sin \left (d x +c \right )+a^{4} A \left (d x +c \right )}{d}\) | \(258\) |
default | \(\frac {\frac {B \,b^{4} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+A \,b^{4} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+4 B a \,b^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {4 A a \,b^{3} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 B \,a^{2} b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+6 A \,a^{2} b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+4 B \,a^{3} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+4 A \sin \left (d x +c \right ) a^{3} b +B \,a^{4} \sin \left (d x +c \right )+a^{4} A \left (d x +c \right )}{d}\) | \(258\) |
risch | \(a^{4} x A +3 x A \,a^{2} b^{2}+\frac {3 x A \,b^{4}}{8}+2 x B \,a^{3} b +\frac {3 x B a \,b^{3}}{2}+\frac {4 \sin \left (d x +c \right ) A \,a^{3} b}{d}+\frac {3 \sin \left (d x +c \right ) A a \,b^{3}}{d}+\frac {\sin \left (d x +c \right ) B \,a^{4}}{d}+\frac {9 \sin \left (d x +c \right ) B \,a^{2} b^{2}}{2 d}+\frac {5 \sin \left (d x +c \right ) B \,b^{4}}{8 d}+\frac {\sin \left (5 d x +5 c \right ) B \,b^{4}}{80 d}+\frac {\sin \left (4 d x +4 c \right ) A \,b^{4}}{32 d}+\frac {\sin \left (4 d x +4 c \right ) B a \,b^{3}}{8 d}+\frac {\sin \left (3 d x +3 c \right ) A a \,b^{3}}{3 d}+\frac {\sin \left (3 d x +3 c \right ) B \,a^{2} b^{2}}{2 d}+\frac {5 \sin \left (3 d x +3 c \right ) B \,b^{4}}{48 d}+\frac {3 \sin \left (2 d x +2 c \right ) A \,a^{2} b^{2}}{2 d}+\frac {\sin \left (2 d x +2 c \right ) A \,b^{4}}{4 d}+\frac {\sin \left (2 d x +2 c \right ) B \,a^{3} b}{d}+\frac {\sin \left (2 d x +2 c \right ) B a \,b^{3}}{d}\) | \(308\) |
norman | \(\frac {\left (a^{4} A +3 A \,a^{2} b^{2}+\frac {3}{8} A \,b^{4}+2 B \,a^{3} b +\frac {3}{2} B a \,b^{3}\right ) x +\left (a^{4} A +3 A \,a^{2} b^{2}+\frac {3}{8} A \,b^{4}+2 B \,a^{3} b +\frac {3}{2} B a \,b^{3}\right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (5 a^{4} A +15 A \,a^{2} b^{2}+\frac {15}{8} A \,b^{4}+10 B \,a^{3} b +\frac {15}{2} B a \,b^{3}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (5 a^{4} A +15 A \,a^{2} b^{2}+\frac {15}{8} A \,b^{4}+10 B \,a^{3} b +\frac {15}{2} B a \,b^{3}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (10 a^{4} A +30 A \,a^{2} b^{2}+\frac {15}{4} A \,b^{4}+20 B \,a^{3} b +15 B a \,b^{3}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (10 a^{4} A +30 A \,a^{2} b^{2}+\frac {15}{4} A \,b^{4}+20 B \,a^{3} b +15 B a \,b^{3}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {4 \left (180 A \,a^{3} b +100 A a \,b^{3}+45 B \,a^{4}+150 B \,a^{2} b^{2}+29 B \,b^{4}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}+\frac {\left (32 A \,a^{3} b -24 A \,a^{2} b^{2}+32 A a \,b^{3}-5 A \,b^{4}+8 B \,a^{4}-16 B \,a^{3} b +48 B \,a^{2} b^{2}-20 B a \,b^{3}+8 B \,b^{4}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (32 A \,a^{3} b +24 A \,a^{2} b^{2}+32 A a \,b^{3}+5 A \,b^{4}+8 B \,a^{4}+16 B \,a^{3} b +48 B \,a^{2} b^{2}+20 B a \,b^{3}+8 B \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (192 A \,a^{3} b -72 A \,a^{2} b^{2}+128 A a \,b^{3}-3 A \,b^{4}+48 B \,a^{4}-48 B \,a^{3} b +192 B \,a^{2} b^{2}-12 B a \,b^{3}+16 B \,b^{4}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {\left (192 A \,a^{3} b +72 A \,a^{2} b^{2}+128 A a \,b^{3}+3 A \,b^{4}+48 B \,a^{4}+48 B \,a^{3} b +192 B \,a^{2} b^{2}+12 B a \,b^{3}+16 B \,b^{4}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}\) | \(673\) |
a^4*x*A+(A*b^4+4*B*a*b^3)/d*(1/4*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+ 3/8*d*x+3/8*c)+1/3*(4*A*a*b^3+6*B*a^2*b^2)/d*(2+cos(d*x+c)^2)*sin(d*x+c)+( 6*A*a^2*b^2+4*B*a^3*b)/d*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+(4*A*a^ 3*b+B*a^4)/d*sin(d*x+c)+1/5*B*b^4/d*(8/3+cos(d*x+c)^4+4/3*cos(d*x+c)^2)*si n(d*x+c)
Time = 0.28 (sec) , antiderivative size = 197, normalized size of antiderivative = 0.82 \[ \int (a+b \cos (c+d x))^4 (A+B \cos (c+d x)) \, dx=\frac {15 \, {\left (8 \, A a^{4} + 16 \, B a^{3} b + 24 \, A a^{2} b^{2} + 12 \, B a b^{3} + 3 \, A b^{4}\right )} d x + {\left (24 \, B b^{4} \cos \left (d x + c\right )^{4} + 120 \, B a^{4} + 480 \, A a^{3} b + 480 \, B a^{2} b^{2} + 320 \, A a b^{3} + 64 \, B b^{4} + 30 \, {\left (4 \, B a b^{3} + A b^{4}\right )} \cos \left (d x + c\right )^{3} + 16 \, {\left (15 \, B a^{2} b^{2} + 10 \, A a b^{3} + 2 \, B b^{4}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (16 \, B a^{3} b + 24 \, A a^{2} b^{2} + 12 \, B a b^{3} + 3 \, A b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, d} \]
1/120*(15*(8*A*a^4 + 16*B*a^3*b + 24*A*a^2*b^2 + 12*B*a*b^3 + 3*A*b^4)*d*x + (24*B*b^4*cos(d*x + c)^4 + 120*B*a^4 + 480*A*a^3*b + 480*B*a^2*b^2 + 32 0*A*a*b^3 + 64*B*b^4 + 30*(4*B*a*b^3 + A*b^4)*cos(d*x + c)^3 + 16*(15*B*a^ 2*b^2 + 10*A*a*b^3 + 2*B*b^4)*cos(d*x + c)^2 + 15*(16*B*a^3*b + 24*A*a^2*b ^2 + 12*B*a*b^3 + 3*A*b^4)*cos(d*x + c))*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 580 vs. \(2 (248) = 496\).
Time = 0.31 (sec) , antiderivative size = 580, normalized size of antiderivative = 2.41 \[ \int (a+b \cos (c+d x))^4 (A+B \cos (c+d x)) \, dx=\begin {cases} A a^{4} x + \frac {4 A a^{3} b \sin {\left (c + d x \right )}}{d} + 3 A a^{2} b^{2} x \sin ^{2}{\left (c + d x \right )} + 3 A a^{2} b^{2} x \cos ^{2}{\left (c + d x \right )} + \frac {3 A a^{2} b^{2} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} + \frac {8 A a b^{3} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {4 A a b^{3} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 A b^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 A b^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 A b^{4} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 A b^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 A b^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {B a^{4} \sin {\left (c + d x \right )}}{d} + 2 B a^{3} b x \sin ^{2}{\left (c + d x \right )} + 2 B a^{3} b x \cos ^{2}{\left (c + d x \right )} + \frac {2 B a^{3} b \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} + \frac {4 B a^{2} b^{2} \sin ^{3}{\left (c + d x \right )}}{d} + \frac {6 B a^{2} b^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 B a b^{3} x \sin ^{4}{\left (c + d x \right )}}{2} + 3 B a b^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )} + \frac {3 B a b^{3} x \cos ^{4}{\left (c + d x \right )}}{2} + \frac {3 B a b^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {5 B a b^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{2 d} + \frac {8 B b^{4} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {4 B b^{4} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {B b^{4} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + B \cos {\left (c \right )}\right ) \left (a + b \cos {\left (c \right )}\right )^{4} & \text {otherwise} \end {cases} \]
Piecewise((A*a**4*x + 4*A*a**3*b*sin(c + d*x)/d + 3*A*a**2*b**2*x*sin(c + d*x)**2 + 3*A*a**2*b**2*x*cos(c + d*x)**2 + 3*A*a**2*b**2*sin(c + d*x)*cos (c + d*x)/d + 8*A*a*b**3*sin(c + d*x)**3/(3*d) + 4*A*a*b**3*sin(c + d*x)*c os(c + d*x)**2/d + 3*A*b**4*x*sin(c + d*x)**4/8 + 3*A*b**4*x*sin(c + d*x)* *2*cos(c + d*x)**2/4 + 3*A*b**4*x*cos(c + d*x)**4/8 + 3*A*b**4*sin(c + d*x )**3*cos(c + d*x)/(8*d) + 5*A*b**4*sin(c + d*x)*cos(c + d*x)**3/(8*d) + B* a**4*sin(c + d*x)/d + 2*B*a**3*b*x*sin(c + d*x)**2 + 2*B*a**3*b*x*cos(c + d*x)**2 + 2*B*a**3*b*sin(c + d*x)*cos(c + d*x)/d + 4*B*a**2*b**2*sin(c + d *x)**3/d + 6*B*a**2*b**2*sin(c + d*x)*cos(c + d*x)**2/d + 3*B*a*b**3*x*sin (c + d*x)**4/2 + 3*B*a*b**3*x*sin(c + d*x)**2*cos(c + d*x)**2 + 3*B*a*b**3 *x*cos(c + d*x)**4/2 + 3*B*a*b**3*sin(c + d*x)**3*cos(c + d*x)/(2*d) + 5*B *a*b**3*sin(c + d*x)*cos(c + d*x)**3/(2*d) + 8*B*b**4*sin(c + d*x)**5/(15* d) + 4*B*b**4*sin(c + d*x)**3*cos(c + d*x)**2/(3*d) + B*b**4*sin(c + d*x)* cos(c + d*x)**4/d, Ne(d, 0)), (x*(A + B*cos(c))*(a + b*cos(c))**4, True))
Time = 0.20 (sec) , antiderivative size = 246, normalized size of antiderivative = 1.02 \[ \int (a+b \cos (c+d x))^4 (A+B \cos (c+d x)) \, dx=\frac {480 \, {\left (d x + c\right )} A a^{4} + 480 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{3} b + 720 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} b^{2} - 960 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} b^{2} - 640 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a b^{3} + 60 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a b^{3} + 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A b^{4} + 32 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} B b^{4} + 480 \, B a^{4} \sin \left (d x + c\right ) + 1920 \, A a^{3} b \sin \left (d x + c\right )}{480 \, d} \]
1/480*(480*(d*x + c)*A*a^4 + 480*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*a^3*b + 720*(2*d*x + 2*c + sin(2*d*x + 2*c))*A*a^2*b^2 - 960*(sin(d*x + c)^3 - 3 *sin(d*x + c))*B*a^2*b^2 - 640*(sin(d*x + c)^3 - 3*sin(d*x + c))*A*a*b^3 + 60*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*B*a*b^3 + 15*( 12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*A*b^4 + 32*(3*sin(d *x + c)^5 - 10*sin(d*x + c)^3 + 15*sin(d*x + c))*B*b^4 + 480*B*a^4*sin(d*x + c) + 1920*A*a^3*b*sin(d*x + c))/d
Time = 0.33 (sec) , antiderivative size = 212, normalized size of antiderivative = 0.88 \[ \int (a+b \cos (c+d x))^4 (A+B \cos (c+d x)) \, dx=\frac {B b^{4} \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {1}{8} \, {\left (8 \, A a^{4} + 16 \, B a^{3} b + 24 \, A a^{2} b^{2} + 12 \, B a b^{3} + 3 \, A b^{4}\right )} x + \frac {{\left (4 \, B a b^{3} + A b^{4}\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (24 \, B a^{2} b^{2} + 16 \, A a b^{3} + 5 \, B b^{4}\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac {{\left (4 \, B a^{3} b + 6 \, A a^{2} b^{2} + 4 \, B a b^{3} + A b^{4}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (8 \, B a^{4} + 32 \, A a^{3} b + 36 \, B a^{2} b^{2} + 24 \, A a b^{3} + 5 \, B b^{4}\right )} \sin \left (d x + c\right )}{8 \, d} \]
1/80*B*b^4*sin(5*d*x + 5*c)/d + 1/8*(8*A*a^4 + 16*B*a^3*b + 24*A*a^2*b^2 + 12*B*a*b^3 + 3*A*b^4)*x + 1/32*(4*B*a*b^3 + A*b^4)*sin(4*d*x + 4*c)/d + 1 /48*(24*B*a^2*b^2 + 16*A*a*b^3 + 5*B*b^4)*sin(3*d*x + 3*c)/d + 1/4*(4*B*a^ 3*b + 6*A*a^2*b^2 + 4*B*a*b^3 + A*b^4)*sin(2*d*x + 2*c)/d + 1/8*(8*B*a^4 + 32*A*a^3*b + 36*B*a^2*b^2 + 24*A*a*b^3 + 5*B*b^4)*sin(d*x + c)/d
Time = 0.96 (sec) , antiderivative size = 307, normalized size of antiderivative = 1.27 \[ \int (a+b \cos (c+d x))^4 (A+B \cos (c+d x)) \, dx=A\,a^4\,x+\frac {3\,A\,b^4\,x}{8}+\frac {3\,B\,a\,b^3\,x}{2}+2\,B\,a^3\,b\,x+\frac {B\,a^4\,\sin \left (c+d\,x\right )}{d}+\frac {5\,B\,b^4\,\sin \left (c+d\,x\right )}{8\,d}+3\,A\,a^2\,b^2\,x+\frac {A\,b^4\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,b^4\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {5\,B\,b^4\,\sin \left (3\,c+3\,d\,x\right )}{48\,d}+\frac {B\,b^4\,\sin \left (5\,c+5\,d\,x\right )}{80\,d}+\frac {A\,a\,b^3\,\sin \left (3\,c+3\,d\,x\right )}{3\,d}+\frac {B\,a\,b^3\,\sin \left (2\,c+2\,d\,x\right )}{d}+\frac {B\,a^3\,b\,\sin \left (2\,c+2\,d\,x\right )}{d}+\frac {B\,a\,b^3\,\sin \left (4\,c+4\,d\,x\right )}{8\,d}+\frac {9\,B\,a^2\,b^2\,\sin \left (c+d\,x\right )}{2\,d}+\frac {3\,A\,a^2\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d}+\frac {B\,a^2\,b^2\,\sin \left (3\,c+3\,d\,x\right )}{2\,d}+\frac {3\,A\,a\,b^3\,\sin \left (c+d\,x\right )}{d}+\frac {4\,A\,a^3\,b\,\sin \left (c+d\,x\right )}{d} \]
A*a^4*x + (3*A*b^4*x)/8 + (3*B*a*b^3*x)/2 + 2*B*a^3*b*x + (B*a^4*sin(c + d *x))/d + (5*B*b^4*sin(c + d*x))/(8*d) + 3*A*a^2*b^2*x + (A*b^4*sin(2*c + 2 *d*x))/(4*d) + (A*b^4*sin(4*c + 4*d*x))/(32*d) + (5*B*b^4*sin(3*c + 3*d*x) )/(48*d) + (B*b^4*sin(5*c + 5*d*x))/(80*d) + (A*a*b^3*sin(3*c + 3*d*x))/(3 *d) + (B*a*b^3*sin(2*c + 2*d*x))/d + (B*a^3*b*sin(2*c + 2*d*x))/d + (B*a*b ^3*sin(4*c + 4*d*x))/(8*d) + (9*B*a^2*b^2*sin(c + d*x))/(2*d) + (3*A*a^2*b ^2*sin(2*c + 2*d*x))/(2*d) + (B*a^2*b^2*sin(3*c + 3*d*x))/(2*d) + (3*A*a*b ^3*sin(c + d*x))/d + (4*A*a^3*b*sin(c + d*x))/d